/* 
  Copyright (c) SilverLining 2015
  Date:    2016-1-7
  File:    BinaryArchiver.h  
  Description: 

*/

#pragma once

namespace SL
{
	namespace M
	{
		/// <summary>
		/// Represent a binary archiver for object data.
		/// </summary>
		public ref class BinaryArchiver : Archiver
		{
		public:
			BinaryArchiver();
			~BinaryArchiver();
			!BinaryArchiver();

			/// <summary>
			/// Archive the root object.
			/// </summary>
			/// <param name="root">The root object to archive.</param>
			/// <returns>The archived binary data.</returns>
			array<byte>^ Archive(GameObject^ root);
			/// <summary>
			/// Unarchive the root object.
			/// </summary>
			/// <param name="root">The root object to unarchive, which must have been constructed prior to calling this method.</param>
			/// <param name="data">The data containing the archived object.</param>
			void Unarchive(GameObject^ root, array<byte>^ data);

		private:
			m::io::file_buffer* _Buffer;
		};
	}
}
